/*
 * @Author: CQJ
 * @Date: 2022-08-25 20:00:27
 * @LastEditors: CQJ
 * @LastEditTime: 2022-08-27 14:27:19
 * @Description:
 */
import { reactive } from 'vue'

interface TemplateState {
  // 关键词
  name: string | undefined
  start_time: string | undefined
  publish_status?: number
  end_time: string | undefined
  user_id: string | undefined
}

// 状态管理
export const templateState = reactive<TemplateState>({
  name: undefined,
  publish_status: 2,
  start_time: undefined,
  end_time: undefined,
  user_id: undefined
})
interface IStatus {
  //列表类型切换
  isActiveModule: boolean
  isDisableModule: boolean
  isBySearch: boolean
  status: number
}
// 列表类型切换
export const statusState = reactive<IStatus>({
  isActiveModule: false,
  isDisableModule: false,
  isBySearch: false,
  status: 1
})
export const resetState = () => {
  templateState.name = undefined
  templateState.start_time = undefined
  templateState.end_time = undefined
  statusState.status = 1
}
